import request from '@/utils/request'

// 获取企业列表
export function getEnterpriseListAPI(params) {
  return request({
    url: '/park/enterprise',
    params
  })
}

// 获取行业列表
export function getIndustryListAPI() {
  return request({
    url: '/park/industry'
  })
}

// 上传营业执照
export function uploadAPI(data) {
  return request({
    url: '/upload',
    method: 'post',
    data
  })
}

// 增加企业
export function createEnterpriseAPI(data) {
  return request({
    url: '/park/enterprise',
    method: 'post',
    data
  })
}

// 获取合同详情
export function getEnterpriseDetailAPI(id) {
  return request({
    url: `/park/enterprise/${id}`
  })
}

// 编辑修改企业
export function updateExterpriseAPI(data) {
  return request({
    url: '/park/enterprise',
    method: 'put',
    data
  })
}

// 删除企业
export function delExterpriseAPI(id) {
  return request({
    url: `/park/enterprise/${id}`,
    method: 'delete'
  })
}

// 获取楼宇列表
export function getRentBuildListAPI() {
  return request({
    url: '/park/rent/building'
  })
}

// 创建合同
export function createRentAPI(data) {
  return request({
    url: '/park/enterprise/rent',
    method: 'post',
    data
  })
}

// 获取当前合同列表
export function getRentListAPI(id) {
  return request({
    url: `/park/enterprise/rent/${id}`
  })
}

// 退租
export function outRentAPI(rentId) {
  return request({
    url: `/park/enterprise/rent/${rentId}`,
    method: 'put'
  })
}

// 获取企业详情
export function getEnterpriseDetail(id) {
  return request({
    url: `/park/enterprise/${id}`
  })
}

